<%--
  Created by IntelliJ IDEA.
  User: 骆鹏
  Date: 2017/7/27
  Time: 11:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>

<html>
<head>
    <title>待办事件</title>
    <meta name="viewport" content="width=device-width, initial-scale=0.3, user-scalable=0, minimum-scale=0, maximum-scale=5.0,user-scalable=yes">
    <link rel="stylesheet" href="/css/officialDocument/officialDocument.css">
    <link rel="stylesheet" href="/lib/layer/skin/default/layer.css">
    <link rel="stylesheet" href="/lib/laydate/need/laydate.css">
    <link rel="stylesheet" href="/lib/pagination/style/pagination.css">
    <link rel="stylesheet" href="/css/base.css">
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="/lib/layer/layer.js?20201106"></script>
    <script src="/js/base/base.js"></script>
    <script src="/lib/laydate/laydate.js"></script>
    <script src="/lib/pagination/js/jquery.pagination.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="headTop">
    <div class="headImg">
        <img src="/img/document/icon_myDispatch.png" alt="">
    </div>
    <div class="divTitle">
        待办事件
    </div>
</div>
<div style="margin: 0 auto;margin-top: 46px;height: 60px;width: 97%;" class="clearfix">
    <%--<label class="fl" style="margin-top: 16px;">--%>
        <%--<span class="fl" style="margin-top: 5px;"><fmt:message code="doc.th.recordType"/>：</span>--%>
        <%--<select name="dispatchType" id="">--%>
            <%--<option value=""><fmt:message code="hr.th.PleaseSelect"/></option>--%>
        <%--</select>--%>
    <%--</label>--%>

    <%--<label class="fl clearfix" style="margin-top: 16px;margin-left: 10px;">--%>
        <%--<span class="fl" style="margin-top: 5px;"><fmt:message code="global.lang.date"/>：</span>--%>
        <%--<label class="fl">--%>
            <%--<input name="printDate"  placeholder="<fmt:message code="doc.th.enterDate"/>" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" type="text">--%>
        <%--</label>--%>
    <%--</label>--%>
    <%--<label class="fl clearfix" style="margin-top: 16px;margin-left: 10px;" >--%>
        <%--<span class="fl" style="margin-top: 5px;"><fmt:message code="notice.th.title"/>：</span>--%>
        <%--<label class="fl"><input name="title" placeholder="<fmt:message code="global.lang.printsubject"/>"  type="text"></label>--%>
    <%--</label>--%>
    <%--<label class="fl clearfix" style="margin-top: 16px;margin-left: 10px;" >--%>
        <%--<span class="fl" style="margin-top: 5px;"><fmt:message code="notice.th.state"/>：</span>--%>
        <%--<label class="fl"><select name="status">--%>
            <%--<option value=""><fmt:message code="hr.th.PleaseSelect"/></option>--%>
            <%--<option value="1"><fmt:message code="sup.th.NotReceived"/></option>--%>
            <%--<option value="2"><fmt:message code="lang.th.Process"/></option>--%>
            <%--<option value="3"><fmt:message code="doc.th.ToReceive"/></option>--%>
            <%--<option value="4"><fmt:message code="sup.th.HaveGoneThrough"/></option>--%>
        <%--</select></label>--%>
        <%--<button  type="button" class="Query fl"><fmt:message code="global.lang.query"/></button>--%>
    <%--</label>--%>

</div>


<div class="pagediv" style="margin: 0 auto;width: 97%;">
    <table>
        <thead>
        <tr>
            <th>序号</th>
            <th>事件描述</th>
            <th>事件类型</th>
            <th>上报人</th>
            <th>上报时间</th>
            <th>所属网格</th>
            <th>流程状态</th>
            <th>流程步骤</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        </tbody>
    </table>
</div>
<div id="dbgz_page" class="M-box3 fr" style="display: none">

</div>
<script>
    var getobj=$.GetRequest()
    var ajaxPage={
        data:{
            page:1,//当前处于第几页
            pageSize:10//一页显示几条
        },
        init:function () {


        },
        page:function () {
            var me=this;
            if(getobj.type=='all'){
                this.data.eventType=getobj.id;
            }

            $.get('/gridEvent/selWillGridSendOrReceive',me.data,function (json) {

                var str='';
                var arr=json.datas
                for(var i=0;i<arr.length;i++){
                    str+='<tr>' +
                        '<td>'+(i+1)+'</td>' +
                        '<td>'+arr[i].eventInfo+'</td>' +
                        '<td>'+arr[i].codeName+'</td>' +
                        '<td>'+arr[i].createrName+'</td>' +
                        '<td>'+arr[i].dateTime+'</td>' +
                        '<td>'+arr[i].gridName+'</td>' +
                        '<td>'+function () {
                            if(arr[i].prFlag==1){
                                return '<fmt:message code="lang.th.will"/>'
                            }else {
                                return '<fmt:message code="lang.th.Process"/>'
                            }
                        }()+'</td>' +
                        '<td>第'+arr[i].step+'步：'+arr[i].prcsName+'</td>' +
                        '<td><a href="/street/workflow/work/workform?opflag=1&flowId='+arr[i].flowId+'&prcsId='+arr[i].realPrcsId+'&flowStep='+arr[i].step
                        +'&runId='+arr[i].rumId+'&tabId='+arr[i].eventId+'&tableName=grid_event&isNomalType=true&hidden=true" class="checkall" target="_blank">办理</a></td>' +
                        '</tr>'
                }
                $('.pagediv table tbody').html(str)
                if(json.total>10){
                    $('#dbgz_page').show();
                    me.pageTwo(json.total, me.data.pageSize, me.data.page)
                }else{
                    $('#dbgz_page').hide();
                }
//                me.pageTwo(json.total,me.data.pageSize,me.data.page)

            },'json')
        },
        pageTwo:function (totalData, pageSize,indexs) {
            var mes=this;
            $('#dbgz_page').pagination({
                totalData: totalData,
                showData: pageSize,
                jump: true,
                coping: true,
                homePage:'',
                endPage: '',
                current:indexs||1,
                callback: function (index) {
                    mes.data.page=index.getCurrent();
                    mes.page();
                }
            });
        }
    }

    ajaxPage.page()
//    $('.Query').click(function () {
//        ajaxPage.data.page=1;
//        ajaxPage.page()
//    })



</script>
</body>
</html>
